<!DOCTYPE html>
<title>DocumentType.cloneNode()</title>
<link rel="help" href="https://dom.spec.whatwg.org/#dom-node-clonenode">
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script>
setup({single_test: true});

assert_not_equals(document.doctype, null);
assert_equals(document.doctype.parentNode, document);

var cd = document.doctype.cloneNode(false);
assert_not_equals(cd, null);
assert_equals(cd.publicId, document.doctype.publicId);
assert_equals(cd.systemId, document.doctype.systemId);
assert_equals(cd.parentNode, null);
assert_equals(cd.ownerDocument, document);

var doc = document.implementation.createDocument(null, null, null);
cd = doc.importNode(cd, true);

assert_equals(cd.publicId, document.doctype.publicId);
assert_equals(cd.systemId, document.doctype.systemId);
assert_equals(cd.parentNode, null);
assert_equals(cd.ownerDocument, doc);
doc.appendChild(cd);
assert_equals(cd.parentNode, doc);

var cd = document.implementation.createDocumentType(
	"a", "b", "c").cloneNode(false);
assert_equals(cd.name, 'a');
assert_equals(cd.publicId, 'b');
assert_equals(cd.systemId, 'c');
assert_equals(cd.parentNode, null);
assert_equals(cd.ownerDocument, document);
done();
</script>
